<template>
	<view class="container" :style="{paddingTop: statusBarHeight + 'px', background: 'linear-gradient(to bottom, #FF2F3A 0%, #FE4650 '+ (statusBarHeight + 44)+'px ,#F8F8F8  672rpx ,  #F8F8F8 100%)'}">
		<view style="position: fixed; top: 0; left: 0; width: 100vw; background: linear-gradient(to bottom, #FF2F3A 0% ,  #FE4650 100%);;z-index: 10;" :style="{paddingTop: statusBarHeight + 44 + 'px'}">
		</view>
		<uni-nav-bar title="我的佣金" :border="false" left-icon="left"  background-color="transparent" fixed color="#fff" class="nav_bar" @clickLeft="back" ></uni-nav-bar>
		<view class="center">
			<view class="right" @click="toCashWithdrawalDetail">
				提现记录
			</view>
			<view class="number">
				{{number}}
			</view>
			<view class="title">
				当前佣金(元)
			</view>
			<view class="btns">
				<button type="primary" class="btn" @click="toDetail" style="color: #000000;border: 2rpx solid #ddd;background-color: #fff;">佣金明细</button>
				<button type="primary" class="btn" @click="toCashWithdrawal" style="background-color: #fb2e25; color: #fff;">我要提现</button>
			</view>
		</view>
		<view class="tips">
			温馨说明：</br>
			1、佣金明细是显示所有的佣金记录，相关说明：</br>
			2、用户申请佣金提现，需要扣除6.0%的手续费；</br>
			3、佣金统计数据如果有延迟，请耐心等待或联系客服。
		</view>
	</view>
</template>

<script>
	import {getMyBrokerage} from '@/api/api.js'
	export default {
		data() {
			return {
				statusBarHeight:'',
				list: [{
						url: '/static/CooperationMenDianFuZeRen.png',
						text: '门店负责人',
						type: 'CooperationMenDianFuZeRen'
					},
					{
						url: '/static/CooperationChuangLian.png',
						text: '联创',
						type: 'CooperationChuangLian'
					}
				],
				list1: [{
						url: '/static/CooperationHeHuoRen.png',
						text: '合伙人',
						type: 'CooperationHeHuoRen'
					},
					{
						url: '/static/CooperationDaiLi.png',
						text: '代理',
						type: 'CooperationDaiLi'
					},
					{
						url: '/static/CooperationHuiYuan.png',
						text: '会员',
						type: 'CooperationHuiYuan'
					}
				],
				number:0
			};
		},
		onShow() {
			this.getShopList()
			this.GetStatusBarHeight();
		},
		methods:{
			//获取状态栏的高度
			GetStatusBarHeight() {
			    let that = this;
			       wx.getSystemInfo({
			        success: function (res) {
			            that.statusBarHeight = res.statusBarHeight;
			        },
			    });
			},
			getShopList(){
				getMyBrokerage().then(res=>{
					this.number = res.data.data.reward
				})
			},
			back(){
				uni.navigateBack()
			},
			toDetail(){
				uni.navigateTo({url:'/pages/my/myCommissionDetail/myCommissionDetail'})
			},
			toCashWithdrawal(){
				uni.navigateTo({url:'/pages/my/cashWithdrawal/cashWithdrawal'})
			},
			toCashWithdrawalDetail(){
				uni.navigateTo({url:'/pages/my/cashWithdrawalDetail/cashWithdrawalDetail'})
			}
		}
	}
</script>

<style lang="scss" scoped>
.container {
	min-height: 100vh;
	width: 100%;
	background: linear-gradient(to bottom, #FF2F3A 0% ,#F8F8F8  672rpx ,  #F8F8F8 100%);
	// padding: 0 24rpx;
	padding-top: var(--status-bar-height);
	font-family: PingFangSC-Semibold, PingFang SC;
}
.center {
	background-color: #fff;
	padding: 68rpx;
	border-radius: 16rpx;
	margin: 24rpx 24rpx 0 ;
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	.right {
		position: absolute;
		top: 40rpx;
		right: 0;
		background-color: #ffe9e8;
		color: #f22f22;
		padding:0 20rpx 0 30rpx;
		border-radius: 20rpx 0 0 20rpx;
		height: 40rpx;
		line-height: 40rpx;
		font-size: 22rpx;
	}
	.number {
		margin-top: 50rpx;
		font-size: 60rpx;
		color: #f22f22;
		font-weight: 500;
	}
	.title {
		margin-top: 10rpx;
		font-size: 24rpx;
		color: #ddd;
	}
	.btns {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 50rpx;
		.btn {
			width: 44%;
			height: 80rpx;
			border-radius: 40rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: 400;
		}
	}
}

.tips {
	padding: 50rpx;
	background-image: url(../../../static/dianzan.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	margin: 28rpx 4rpx 0;
	color: #A86C50;
	font-size: 24rpx;
	line-height: 34rpx;
}

</style>
